// 1. 导入
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'

// 2. 创建路由对象
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: () => import('@/views/home.vue')
    },
    {
      path: '/editMarket',
      component: () => import('@/views/pages/hqing/editMarket.vue')
    },
    {
      path: '/addMarket',
      component: () => import('@/views/pages/hqing/addMarket.vue')
    },
    {
      path: '/attribute',
      component: () => import('@/views/pages/hqing/attribute.vue')
    },
    {
      path: '/marketInfo',
      component: () => import('@/views/pages/hqing/marketInfo.vue')
    },
    {
      path: '/email-list',
      component: () => import('@/views/pages/email/index.vue')
    },
    {
      path: '/write-email',
      component: () => import('@/views/pages/email/writeEmail.vue')
    },
    {
      path: '/echarts',
      component: () => import('@/views/pages/echarts/index.vue')
    },
    {
      path: '/jiaoyi',
      component: () => import('@/views/pages/jiaoyi/index.vue')
    },
    {
      path: '/lishi',
      component: () => import('@/views/pages/lishi/index.vue')
    },
    {
      path: '/currency',
      component: () => import('@/views/pages/jiaoyi/currency.vue')
    },
    {
      path: '/setup',
      component: () => import('@/views/pages/setup/index.vue')
    },
    {
      path: '/setting',
      component: () => import('@/views/pages/setup/settings.vue')
    },
    {
      path: '/logs',
      component: () => import('@/views/pages/setup/log.vue')
    },
    {
      path: '/account',
      component: () => import('@/views/pages/account/index.vue')
    },
    {
      path: '/lock',
      component: () => import('@/views/pages/account/lock.vue')
    },
    {
      path: '/handlerCurrency',
      component: () => import('@/views/pages/handlerCurrency/index.vue')
    },
    {
      path: '/account/search',
      component: () => import('@/views/pages/account/search.vue')
    },
    {
      path: '/account/login',
      component: () => import('@/views/pages/account/login.vue')
    },
    {
      path: '/account/password',
      component: () => import('@/views/pages/account/password.vue')
    }
  ]
})
router.beforeEach((to, from, next) => {
  next()
})

// 3. 导出
export default router
